function RukeyJs(){
	this.Ajax=new AjaxClass();
}
RukeyJs.prototype={
	isNull:function(data){
		if(data===null||data==""||data.replace(/[\s\n\r]/g,"")==""){
			return true;
		}else{
			return false;
		}	
	},
	isEmail:function(data){
		var Reg=/^[\w\-\.]+@[\w\-]+(\.\w+)+$/;
		return Reg.test(data)&&data.length>6;
	},
	getObj:function(objId){
		return document.getElementById(objId);
	}
}
function AjaxClass(){
}
AjaxClass.prototype={
	getRequest:function(){
		var request=false;
		try{
			request=new XMLHttpRequest();
		}catch(e){
			try{
				request=new ActiveXObject("Msxml2.XMLHTTP");
			}catch(e){
				try{
					request=new ActiveXObject("Microsoft.XMLHTTP");
				}catch(e){
					request=false;
				}
			}
		}
		return request;
	},
	send:function(url,method,para3,para4){
		this.request=this.getRequest();
		var paraCount=this.send.arguments.length;
		var url=url;
		var method=method;
		if(paraCount==3){
			var data=null;
			var callback=para3;
		}else if(paraCount==4){
			var dataObj=para3;
			var callback=para4;
			var data=[];
			for(key in dataObj){
				data[data.length]=key+"="+dataObj[key];
			}
			data=data.join("&");
		}
		var _ajax=this;
		this.request.open(method,url,true);
		this.request.onreadystatechange=function(){
			_ajax.stateFunc(callback);
		}
		if(method=="POST"){
			this.request.setRequestHeader('Content-type','application/x-www-form-urlencoded;charset=UTF-8;');
		}
		this.request.send(data);
	},
	stateFunc:function(func){
		if(this.request.readyState==4){
			if(this.request.status==200){
				var result=this.request.responseText;
				func(result);
			}
		}
	}
}
var R=Rukey=new RukeyJs();
window.onload=function(){
	Rukey.getObj("pic").onload=(function(){
		var pic=Rukey.getObj("pic");
		var clickArea=Rukey.getObj("clickArea");
		var next=Rukey.getObj("next");
		var pre=Rukey.getObj("pre");
		clickArea.style.width=pic.offsetWidth-24+"px";
		clickArea.style.height=pic.offsetHeight-24+"px";
	})();
}